package lz.controls.nick
{
	/**
	 * 根据时间转为点券 
	 * @author Administrator
	 * 
	 */	
	public class TimeToMoney
	{
		public function TimeToMoney()
		{
		}
		/**
		 * 时间转为点券 
		 * @param $time
		 * @return 
		 * 
		 */		
		public static function timeTocash($time:int):int
		{
			var time:int = Math.ceil($time / 1800);
			var _cost:int = 0;
			while(time >= 12)
			{
				time -= 12;
				_cost += 140;
			}
			if(time == 11)
			{
				time = 0;
				_cost += 140;
			}
			if(time > 0)
			{
				while(time >= 4)
				{
					time -= 4;
					_cost += 50;
				}
				while(time >= 2)
				{
					time -= 2;
					_cost += 28;
				}
				while(time >=1)
				{
					time -= 1;
					_cost += 15;
				}
			}
			
			return _cost;
		}
	}
}